﻿Linux环境下Hadoop的搭建
===============================================================
安装SSH
	ps -e | grep ssh*
	apt-get install openssh-server
	apt-get install openssh-client
	ps -e | grep sshd
	/etc/init.d/ssh start
	
	问题：
		在Ubuntu中，有时候运用sudo  apt-get install 安装软件时，会出现一下的情况
		E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
		E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
	解决：
		1、找到并且杀掉所有的apt-get 和apt进程
			ps -A | grep apt
			$ sudo kill -9 processnumber
			$ sudo kill -SIGKILL processnumber
			$ sudo kill -9 进程ID
			$ sudo kill -SIGKILL  进程ID
		2、删除锁定文件
			$ sudo rm /var/lib/dpkg/lock
			$ sudo dpkg --configure -a
			$ sudo rm /var/lib/apt/lists/lock
			$ sudo rm /var/cache/apt/archives/lock
			$ sudo apt update
				$ sudo apt-get update
===============================================================
更换为国内的源
	一、源文件位置
		备份并替换/etc/apt/sources.list的源内容：
	二、更改源文件内容
		sudo vi /etc/apt/sources.list
		deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
		deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
		deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
		deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
		##测试版源
		deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
		# 源码
		deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
		deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
		deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
		deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
		##测试版源
		deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
		# Canonical 合作伙伴和附加
		deb http://archive.canonical.com/ubuntu/ xenial partner
		deb http://extras.ubuntu.com/ubuntu/ xenial main
		
===============================================================
更改主机名与映射关系
	vim /etc/hostname
	vim /etc/hosts
	hostname

===============================================================
设置固定的IP地址
	http://www.jb51.net/article/118426.htm
	
===============================================================
配置java环境变量
	mkdir /usr/myjavajdk
	tar -zxvf jdk文件 -C /usr/myjavajdk/
	vim etc/profile
	export JAVA_HOME=/usr/myjavajdk/jdk1.8.0_151
	export PATH=$PATH:$JAVA_HOME/bin
	source /etc/profile
	javac
	java -version

===============================================================
ssh免密钥登录
	ssh-keygen -t rsa
	cat ./id_rsa.pub >> ./authorized_keys
	
===============================================================
Linux的启动界面实践
	
	

